import pandas as pd

# 读取Excel文件
excel_file_path = 'excel/软件技术2204班.xlsx'
df = pd.read_excel(excel_file_path)

# 迭代数据框的行，并生成MySQL插入语句
insert_statements = []
for index, row in df.iterrows():
    insert_statement = f"INSERT INTO fly_user (username, email, password, avatar, name, score, class_id, speciality_id, college_id, class_name) VALUES " \
                        f"('{row['手机号码']}', '{row['邮箱']}', 'e10adc3949ba59abbe56e057f20f883e', '', '{row['姓名']}', " \
                        f"'0', '4', '1', '1', '{row['班级']}');"
    insert_statements.append(insert_statement)

# 将插入语句打印到控制台或写入文件
for statement in insert_statements:
    print(statement)
